package lab01;

import javax.swing.*;

public class Test08 {
    public static void main(String[] args) {
        System.out.println("给你一个1至100之间的整数，请猜测这个数");
        int realNumber = (int) (Math.random() * 100) + 1;
        int yourGuess = 0;
        String st = JOptionPane.showInputDialog("输入您的猜测：");
        yourGuess = Integer.parseInt(st);
        while (yourGuess != 78) {
            if (yourGuess > 78) {
                st = JOptionPane.showInputDialog("猜大了，再输入你的猜测：");
                yourGuess = Integer.parseInt(st);
            } else if (yourGuess < 78) {
                st = JOptionPane.showInputDialog("猜小了，再输入你的猜测：");
                yourGuess = Integer.parseInt(st);
            }
        }
        System.out.println("猜对了");
    }
}
